﻿
@{
    ViewBag.Title = ViewBag.Title;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<style type="text/css">
    /*设置最小高度，默认显示滚动条，有效解决页面闪烁问题*/
    .micronews {
        min - height: 1090px;
    }

</style>

<body class="micronews">
    
    <div class="layui-fulid micronews-banner w1000">
        <div class="layui-carousel imgbox" id="micronews-carouse">
            <div carousel-item>
                <div>
                    <p class="title">@ViewBag.news1.NewsTitle</p>
                    <a target="_blank" href="/news/article/@(ViewBag.news1.NewsID).html"><img src="~/Content/wenews/images/caijidatu1000.jpg"></a>
                </div>
                <div>
                    <p class="title">@ViewBag.news2.NewsTitle</p>
                    <a target="_blank" href="/news/article/@(ViewBag.news2.NewsID).html"><img src="~/Content/wenews/images/news_img1.jpg"></a>
                </div>
            </div>
        </div>
    </div>

    <div class="micronews-container w1000">
        <div class="layui-fluid">
            <div class="layui-row">
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md8">
                    <div class="main">
                        <div class="list-item" id="LAY_demo2">

                            @*<div class="item">
                                    <a target="_blank" href="article.html">
                                        <img src="~/Content/wenews/images/news_img11.jpg">
                                    </a>
                                    <div class="item-info">
                                        <h4><a target="_blank" href="article.html">北京的卫生部门调查五星级酒店清洁 “丑闻” 已现场取样，还消费者真相</a></h4>
                                        <div class="b-txt">
                                            <span class="label">娱乐</span>
                                            <span class="icon message">
                                                <i class="layui-icon layui-icon-dialogue"></i>
                                                500条
                                            </span>
                                            <span class="icon time">
                                                <i class="layui-icon layui-icon-log"></i>
                                                10分钟前
                                            </span>
                                        </div>
                                    </div>
                                </div>*@

                            @if (ViewBag.Data != null && ViewBag.Data.Data != null)
                            {
                                foreach (var item in ViewBag.Data.Data)
                                {
                                    <div class="item">
                                        <a target="_blank" href="/news/article/@(item.NewsID).html">
                                            @if (item.CoverImage != null && item.ArticleType == 2 || item.ArticleType == 4)
                                            {
                                                <img width="160" height="100" src="@item.CoverImage" alt="@item.NewsTitle">
                                            }
                                        </a>
                                        <div class="item-info">
                                            <h4><a target="_blank" href="/news/article/@(item.NewsID).html">@item.NewsTitle</a></h4>
                                            <div class="b-txt">
                                                @if (item.ArticleType == 2 || item.ArticleType == 4)
                                                {
                                                    <span class="label">@item.Source</span>
                                                }
                                                <span class="icon message">
                                                    <i class="layui-icon layui-icon-dialogue"></i>
                                                    @item.CommentCount<span>条</span>
                                                </span>
                                                <span class="icon time">
                                                    <i class="layui-icon layui-icon-log"></i>
                                                    @item.CreateTimeStr
                                                </span>
                                            </div>
                                        </div>
                                    </div>

                                }
                            }


                        </div>
                    </div>
                </div>

                @*右侧热门资讯*@
                <div class="layui-col-xs12 layui-col-sm12 layui-col-md4">
                    <div class="popular-info">
                        <div class="layui-card">
                            <div class="layui-card-header">
                                <h3>热门资讯</h3>
                            </div>
                            <div class="layui-card-body">
                                <ul class="list-box" id="hotNewsRight">

                                    @*<li class="list">
                                            <a target="_blank" href="javascript:void(0)">你和我的倾城时光</a><i class="heat-icon"></i>
                                        </li>*@

                                </ul>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div id="micronews-index-list" style="text-align: center; padding:65px 0 0 0"></div>
        </div>
    </div>

    <!-- content-laytpl -->
    <script id="demo" type="text/html">
        {{#  layui.each(d.Data, function(index, item){ }}
        <div class="item">
            {{# if(item.CoverImage && item.ArticleType == 2 || item.ArticleType == 4){ }}
            <a target="_blank" href="/news/article/{{item.NewsID}}.html">
                <img width="160" height="100" src="{{item.CoverImage}}" alt="{{item.NewsTitle}}">
            </a>
            {{#  } }}

            <div class="item-info">
                <h4><a target="_blank" href="/news/article/{{item.NewsID}}.html">{{item.NewsTitle}}</a></h4>
                <div class="b-txt">

                    {{# if(item.ArticleType == 2 || item.ArticleType == 4){ }}
                    <span class="label">{{item.Source}}</span>
                    {{#  } }}

                    <span class="icon message">
                        <i class="layui-icon layui-icon-dialogue"></i>
                        {{item.CommentCount}}条
                    </span>
                    <span class="icon time">
                        <i class="layui-icon layui-icon-log"></i>
                        {{item.CreateTimeStr}}
                    </span>
                </div>
            </div>
        </div>
        {{#  }); }}
    </script>


    <script id="demo2" type="text/html">
        {{#  layui.each(d.Data, function(index, item){ }}
        <li class="list">
            <a target="_blank" href="{{item.NewsUrl}}">{{item.NewsTitle}}</a>
            {{#  if(index < 3){ }}
            <i class="heat-icon"></i>
            {{#  } }}
        </li>
        {{#  }); }}
    </script>


    <script id="demo1" type="text/html">
        <h3>{{ d.title }}</h3>
        <ul>
            {{#  layui.each(d.list, function(index, item){}}
            <li>
                <span>{{ item.modname }}</span>
                <span>{{ item.alias }}：</span>
                <span>{{ item.site || '' }}</span>
            </li>
            {{#  }); }}

            {{#  if(d.list.length === 0){}}
            无数据
            {{#  } }}
        </ul>
    </script>



    <!-- end-content-laytpl-->
    <script type="text/javascript" charset="utf-8">

        //总条数，无用了
        //var pageCount = 50;

        layui.config({base: '/Scripts/wenews/'}).use('index', function () {
            var index = layui.index;
            index.banner()
            index.seachBtn()
            index.arrowutil()
            //index.contFlow()
            index.indexPage('micronews-index-list', @ViewBag.Data.Count)
            index.hotNews()
            //index.footLayout();
        });




    </script>
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</body>

<div class="footer"></div>